package booksys.common;

public class CurrentUser {

    public static final String SESSION_ATTR_NAME="CurrentUser";//session属性名字

    /**
     * 头像存储位置
     */
    public static final String AVATAR_DIR = "./src/main/touxiang";

    public static final String DEFAULT_PASSWORD = "111111";

    private String userId;
    private String userName;
    private String avatar;//头像地址
    private String sex;
    private String email;
    private String pwd;
    private String phone;

    public CurrentUser() {
    }

    public CurrentUser(String userId) {
        this.userId = userId;
    }

    public CurrentUser(String userId, String userName, String avatar,String sex,String email,String pwd,String phone) {
        this.userId = userId;
        this.userName = userName;
        this.avatar = avatar;
        this.sex = sex;
        this.email = email;
        this.pwd=pwd;
        this.phone=phone;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public static String getSessionAttrName() {
        return SESSION_ATTR_NAME;
    }

    public static String getAvatarDir() {
        return AVATAR_DIR;
    }

    public static String getDefaultPassword() {
        return DEFAULT_PASSWORD;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Override
    public String toString() {
        return "CurrentUser{" +
                "userId='" + userId + '\'' +
                ", userName='" + userName + '\'' +
                ", avatar='" + avatar + '\'' +
                ", sex='" + sex + '\'' +
                ", email='" + email + '\'' +
                ", pwd='" + pwd + '\'' +
                ", phone='" + phone + '\'' +
                '}';
    }
}
